package GameContent;

import java.awt.Graphics2D;

import GameData.Vector2D;
import GameResource.TileBP;

public class Tile {
	
	private String overlay;
	//private BufferedImage collision;
	
	private Vector2D pos;
	private int rotation;

	public Tile(TileBP img) {
		setOverlay(img.getOverlay());
		//collision = img.getCollision();
	}

	public Tile(TileBP img, double _x, double _y) {
		setOverlay(img.getOverlay());
		//collision = img.getCollision();
		pos = new Vector2D(_x, _y);
	}

	public String getOverlay() {
		return overlay;
	}

	public void setOverlay(String name) {
		overlay = name;
	}
	
	public void doPaint(Graphics2D G) {
		// TODO
	}
	
	public boolean checkCollision(Vector2D pos) {
		// TODO
		return true;
	}
	
	public Vector2D getPosition() {
		return pos;
	}
	
	public void setPosition(double _x, double _y) {
		pos.x = _x;
		pos.y = _y;
	}
	
	public void setPosition(Vector2D _pos) {
		pos.x = _pos.x;
		pos.y = _pos.y;
	}
	
	public int getRotation() {
		return rotation;
	}
	
	public void setRotation(int rot) {
		rotation = Math.abs(rot % 360);
	}

	public void addRotation(int add) {
		rotation += add;
		rotation = Math.abs(rotation % 360);
	}
	
}
